package game.leon.engine.script;

import game.leon.engine.utils.LinkedNode;

/**
 * User: bianpeng
 * Date: 12-2-3
 */
class Token {
    private int line;    // 行号
    private int type;    // 类型
    public LinkedNode<Token> child;
    public LinkedNode<Token> sibling;
    // value
    public int intVal;
    public String strVal;
    public double numVal;
    public Token(int type, int line) {
        this.type = type;
        this.line = line;
    }
    public int getLine() {
        return line;
    }
    public int getType() {
        return type;
    }
    public void addChild(Token token) {
        child = LinkedNode.cons(token, child);
    }
    public void addSibling(Token token) {
        sibling = LinkedNode.cons(token, sibling);
    }
}
